package com.tengju.user.domain.shared;

import org.springframework.context.ApplicationEvent;

/**
 * @author chenhang
 * @Date 2021/1/15
 */
public class SpringEvent extends ApplicationEvent {

    private static final long serialVersionUID = 411380207095382929L;
    private DomainEvent domainEvent;

    public SpringEvent(Object source) {
        super(source);
        if (source instanceof DomainEvent) {
            this.domainEvent = (DomainEvent) source;
        }
    }

    public DomainEvent getDomainEvent() {
        return domainEvent;
    }
}
